package 自定义数据库连接池;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

public class MyConnection extends abstractConnection {
    private Connection conn;
    private ArrayList<Connection> list;

    public MyConnection(Connection conn, ArrayList<Connection> list) {
        this.conn = conn;
        this.list = list;
    }

    @Override
    public Statement createStatement() throws SQLException {
        return conn.createStatement();
    }

    @Override
    public void close() throws SQLException {
        list.add(this);
        System.out.println("11");
    }
}
